<?php
require_once 'Classes/phpICQ.Classes.php';

/*
 
phpinfo();
require_once 'File/Util.php';
require_once 'Classes/phpICQ.Classes.php';

$fileRestartFlag = ".restart_icq";
file_put_contents($fileRestartFlag, "0");

/*

$ff = new File_Util();
$arr = $ff->listDir("C:\\WebServers\\home\\localhost\\www\\client2\\images\\smiles", FILE_LIST_FILES, FILE_SORT_NAME);
$smiles = explode("\n",file_get_contents("C:\\WebServers\\home\\localhost\\www\\client2\\images\\smiles\\_define.ini"));

$baseconnection->query("TRUNCATE TABLE `smiles`");

if ($arr == null) {
	echo "ERROR!";	
} else {
	
	$id = 0;
	foreach ($arr as $fff) {
		$name = $fff->name;
		
		if (((strpos($name, ".txt") !== false) || (strpos($name, ".ini") !== false))) {
			continue;
		}
		
		$id++;

		$baseconnection->query("INSERT INTO `smiles` (`str`, `filename`) VALUES ('".addslashes(str_replace("\r", "", $smiles[$id-1]))."', '".$name."');");
		echo $smiles[$id-1] . "  -  ". $name;
		echo "\n<br>";
	}
}

*/


$bl = new phpICQ_BaseConnection('mysql://mysqluser:mysqlpass@localhost/my_icq_db');
$bl->query("TRUNCATE TABLE `statuses`");        
$bl->query("INSERT INTO `statuses` VALUES (1, 1, 'STATUS_ONLINE', 'В сети', 'cl-statusicon-icq-online', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (2, 1, 'STATUS_AWAY', 'Ото&#1096;ел', 'cl-statusicon-icq-away', 1, 1)");
//$bl->query("INSERT INTO `statuses` VALUES (2, 1, 'STATUS_AWAY', 'Ото_ел', 'cl-statusicon-icq-away', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (3, 1, 'STATUS_DND', 'Не беспокоить', 'cl-statusicon-icq-dnd', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (4, 1, 'STATUS_DND2', 'Не беспокоить', 'cl-statusicon-icq-dnd', 1, 0)");
$bl->query("INSERT INTO `statuses` VALUES (5, 1, 'STATUS_NA', 'Недоступен', 'cl-statusicon-icq-na', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (6, 1, 'STATUS_NA2', 'Недоступен', 'cl-statusicon-icq-na', 1, 0)");
$bl->query("INSERT INTO `statuses` VALUES (7, 1, 'STATUS_OCCUPIED', 'Занят', 'cl-statusicon-icq-occupied', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (8, 1, 'STATUS_OCCUPIED2', 'Занят', 'cl-statusicon-icq-occupied', 1, 0)");
$bl->query("INSERT INTO `statuses` VALUES (9, 1, 'STATUS_FREE4CHAT', 'Готов поболтать', 'cl-statusicon-icq-free4chat', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (10, 1, 'STATUS_INVISIBLE', 'Невидимый', 'cl-statusicon-icq-invisible', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (11, 1, 'STATUS_EVIL', 'Злой', 'cl-statusicon-icq-evil', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (12, 1, 'STATUS_DEPRESSION', 'Депрессия', 'cl-statusicon-icq-depress', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (13, 1, 'STATUS_ATHOME', 'Дома', 'cl-statusicon-icq-home', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (14, 1, 'STATUS_ATWORK', 'На работе', 'cl-statusicon-icq-work', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (15, 1, 'STATUS_LUNCH', 'Ку&#1096;аю', 'cl-statusicon-icq-lunch', 1, 1)");
//$bl->query("INSERT INTO `statuses` VALUES (15, 1, 'STATUS_LUNCH', 'Ку_аю', 'cl-statusicon-icq-lunch', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (16, 1, 'STATUS_OFFLINE', 'Не в сети', 'cl-statusicon-icq-offline', 0, 1)");

$bl->query("INSERT INTO `statuses` VALUES (17, 2, 'STATUS_ONLINE', 'В сети', 'cl-statusicon-mrimp-online', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (18, 2, 'STATUS_AWAY', 'Ото&#1096;ел', 'cl-statusicon-mrimp-away', 1, 1)");
//$bl->query("INSERT INTO `statuses` VALUES (18, 2, 'STATUS_AWAY', 'Ото_ел', 'cl-statusicon-mrimp-away', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (19, 2, 'STATUS_INVISIBLE', 'Невидимый', 'cl-statusicon-mrimp-invisible', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (20, 2, 'status_chat', 'Готов поболтать', 'cl-statusicon-mrimp-free4chat', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (21, 2, 'status_dnd', 'Не беспокоить', 'cl-statusicon-mrimp-dnd', 1, 1)");
$bl->query("INSERT INTO `statuses` VALUES (22, 2, 'status_0', 'Не в сети', 'cl-statusicon-mrimp-offline', 0, 1)");

echo 'OK!';

?>

